<?php $this->pageHeader('Vakter'); ?>

<?php echo $this->flashMessage()->renderMessages(); ?>

<div class="header_wrapper">
    <h1>Vakter</h1>
    <?php echo $this->filterForm; ?>
</div>

<table class="admin_shifts">
    <thead>
        <tr>
            <th>Navn</th>
            <th>Arrangement</th>
            <th>Startidspunkt</th>
            <th>Sluttidspunkt</th>
            <th>&nbsp;</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach($this->shifts as $shift) : ?>
        <tr>
            <td><a href="<?php echo $this->url(array('module' => 'core', 'controller' => 'shift', 'action' => 'view', 'id' => $shift['id']), null, true); ?>"><?php echo $this->escape($shift['name']); ?></a></td>
            <td><?php echo $this->escape($shift['Event']['name']); ?></td>
            <td>
            <?php
                $date = new RedCross_Date();
                $date->import($shift['from_date']);
                echo $date->getDateTimeStr();
            ?>
            </td>
            <td>
            <?php
                $date->import($shift['to_date']);
                echo $date->getDateTimeStr();
            ?>
            </td>
            <td>
                <a href="<?php echo $this->url(array('module' => 'core', 'controller' => 'shift', 'action' => 'view', 'id' => $shift['id']), null, true); ?>"><img src="<?php echo $this->imageLink('images/icons/shift_go.png'); ?>" alt="Vis" title="Vis" /></a>
                <a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'shift', 'action' => 'edit', 'id' => $shift['id']), null, true); ?>"><img src="<?php echo $this->imageLink('images/icons/shift_edit.png'); ?>" alt="Rediger Vakt" title="Rediger Vakt" /></a>
                <a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'shift', 'action' => 'notify-all', 'id' => $shift['id']), null, true); ?>"><img src="<?php echo $this->imageLink('images/icons/shift_notifyall.png'); ?>" alt="Send vaktutkalling" title="Send vaktutkalling" /></a>
            </td>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>
